<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/

/**
 * Description of Login
 *
 * @author Dennis
 */
class Admin_Form_Login extends Zend_Form {

    public function __construct() {

        parent::__construct($options);

        $this->setName('login');
        $this->setMethod('post');
        $this->setAction('/admin/auth/login/');

        $username = new Zend_Form_Element_Text('username');
        $username->setRequired(true)
                ->setErrorMessages(array(
                'IS_EMPTY' => 'Je moet een waarde invullen'
                ))
                ->setLabel('Gebruikersnaam :');

        $password = new Zend_Form_Element_Password('password');
        $password->setRequired(true)
                ->setErrorMessages(array(
                'IS_EMPTY' => 'Je moet een waarde invullen'
                ))
                ->setLabel('Wachtwoord :');

        $hash = new Zend_Form_Element_Hash('csrf', array('salt' => 'unique'));
        
        $submit = new Zend_Form_Element_Submit('Login');

        $md5 = new Zend_Form_Element_Hidden('md5');

        $this->addElements(array($username, $password, $submit, $md5, $hash));

        $this->addDecorator('FormElements')
                ->addDecorator('HtmlTag', array('tag' => '<dl>', 'class'=>'loginForm'))
                ->addDecorator('Form');
    }

}
?>
